package project.innovation.mooddiagnosis.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import project.innovation.mooddiagnosis.entity.records.RecordInfo;

import java.util.List;

public interface RecordMapper {
    @Delete("DELETE from records where id = #{recordId}")
    int deleteByPrimaryKey(Integer recordId);
    @Insert("INSERT IGNORE INTO records (id, user_id, result, evaluationTime) VALUES (#{id}, #{userId}, #{result}, #{evaluationTime})")
    int insert(RecordInfo record);
    @Select("SELECT * FROM records where user_id = #{userid}")
    List<RecordInfo> selectRecordListByUserId(String userid);
}
